package com.example.role.web;



import com.example.role.pojo.Role;
import com.example.role.service.serviceimpl.RoleServiceImpl;

import com.example.role.util.ServerResponse;
import com.example.role.util.TableServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 角色层，给角色赋予权限，角色管理
 */

@RestController
public class RoleController {
    @Autowired
    RoleServiceImpl roleService;

    @PostMapping("addrole")
    public ServerResponse addRole(Role role) {


        return roleService.addroel(role);
    }

    @PostMapping("queryRole")
    public ServerResponse queryRole(Role role) {

        TableServerResponse tableServerResponse = roleService.queryRole(role);

        return ServerResponse.createSuccess();
    }
}
